using System.Collections.Generic;

using System;

namespace HEFramework
{
    internal class EnumPropertyT : Property
    {
        private Type type;
        private string enumName;

        public void SetEnum(Type _type, string _enumName)
        {
            this.type = _type;
            this.enumName = _enumName;
        }

        protected override bool OnFormatCheck(string _content)
        {
            return Enum.TryParse(type, _content, out object result);
        }

        public override string OnEmptyReplace()
        {
            return "";
        }

        public override string GetParseFunc()
        {
            return "System.Enum.Parse<" + enumName + ">";
        }

        public override string GetArrParseFunc()
        {
            return "DataTableExtension.ParseEnumArr<" + enumName + ">";
        }
    }
}

